package com.tangyuan.user.controller;


import com.tangyuan.common.result.Result;
import com.tangyuan.dto.FirstLoginDto;
import com.tangyuan.user.service.UserLikeService;
import com.tangyuan.user.service.impl.UserServiceImpl;
import com.tangyuan.vo.UserMayKnowVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    public UserServiceImpl userService;
    @Autowired
    private UserLikeService userLikeService;

    @PostMapping("/getMayKnowList")
    public Result<List<UserMayKnowVo>> getMayKnowList(@RequestHeader("userId") Long userId, @RequestBody List<UserMayKnowVo> contact) {
        return Result.ok(userService.getMayKnowList(contact, userId));
    }
    // 首次登录选择自己喜好
    @PostMapping("/firstLogin/addUserLikeByHorizontalTab")
    public Result addUserLikeByHorizontalTab(
            @RequestHeader(name = "userId", required = false) Long userId,
            @RequestBody FirstLoginDto firstLoginDto) {
        return userLikeService.addUserLikeByHorizontalTab(userId, firstLoginDto.getHorizontalTabList());
    }
}
